<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragment :: head">
    <title>登陸</title>
</head>

<body>

<div>
    <form id="form" role="form">
        <div class="form-group">
            <label for="username">邮箱：</label>
            <input type="text" class="form-control" id="username" placeholder="请输入您账号">
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" id="password" placeholder="请输入您的密码">
        </div>

        <button type="button" class="btn btn-default" onclick="btuSubmit()">进入邮箱</button>
    </form>

    <script src="/js/jquery.js" type="text/javascript"></script>
    <script src="/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/js/jquery/jquery-2.2.3.min.js" type="text/javascript"></script>
<script th:inline="javascript">

        function btuSubmit() {

            alert("ddd");

            var json = {username: $('#username').val(), password: $('#password').val()};
            console.log(json);

            $.post('/login', json, function (resp) {
                if(resp=="menu"){
                    window.location.href="/menu";
                }

            })
        }
</script>



</body>
</html>